<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Father(){

        }
        Father.prototype.farm = function(){
            console.log(this.name + '在种田');
        }
        Father.prototype.repair = function(){
            console.log(this.name + '在修理机器');
        }
        Father.prototype.woodwork = function(){
            console.log(this.name + '在做木工');
        }
        function Son(name){
            this.name = name
        }
        Son.prototype = new Father()
        let zs = new Son('张三')
        zs.farm()
        zs.repair()
        zs.woodwork()
    </script>
</body>
</html>